package com.sright.bcard.common.service.share.enums;

/**
 * oss枚举类
 * "ergeng-video" 视频bucket "ergeng-image" 图片bucket "ergeng-static" 静态资源bucket
 * \n5：宣传视频背景图\n6：竖视频\n7：长图片\n8：横视频\n9：分享图
 */
public enum BucketTypeEnum {

    VIDEO("视频" , "ergeng-video"),
    IMAGE("图片", "ergeng-image"),
    STATIC("静态资源", "ergeng-static"),
    ;
    private String name;
    private String value;

    BucketTypeEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static BucketTypeEnum getEnum(String name) {
        try {
            return valueOf(name);
        } catch (Exception e) {
            return null;
        }
    }


    public static BucketTypeEnum getEnumByValue(String value) {
        if (value == null) {
            return null;
        }

        for (BucketTypeEnum item : BucketTypeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
